﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using IHISCETeim.BLL;
using IHISCETeim.Library;
using IHISCETeim.Model;
namespace IHISCETeim.Web.MachineSys.UserModel
{
    public partial class UReturnVisitView : PageBase
    {
        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.查看 };
            }
        }
        protected override string DWZRef
        {
            get { return "UReturnVisitList"; }
        }

        /// <summary>
        /// 需要修改的ID
        /// </summary>
        protected int ID
        {
            get
            {
                return GetRequestValue<int>("ID");
            }
        }

        private UWarrantyCardInfo _obj;
        protected UWarrantyCardInfo obj
        {
            get
            {
                if (_obj == null)
                    _obj = UWarrantyCardController.GetByUWCID(obj2.UWCID);
                return _obj;
                //OMenuController.ge
            }
        }

        private UReturn500VisitInfo _obj2;
        protected UReturn500VisitInfo obj2
        {
            get
            {
                if (_obj2 == null)
                    _obj2 = UReturn500VisitController.GetList(ID);
                return _obj2;
                //OMenuController.ge
            }
        }
        private U4008RecordInfo _obj3;
        protected U4008RecordInfo obj3
        {
            get
            {
                if (_obj3 == null)
                    _obj3 = U4008RecordController.GetByU4RID(obj2.U4RID);
                return _obj3;
                //OMenuController.ge
            }
        }
        private OUserInfo _obj4;
        protected OUserInfo obj4
        {
            get
            {
                if (_obj4 == null)
                    _obj4 = OUserController.GetByUserName(obj3.UserName);
                return _obj4;
                //OMenuController.ge
            }
        }
        protected string GetTimer()
        {
            if (obj2.VisitType == "8")
                return "1";
            if (obj2.VisitType == "70")
                return "2";
            if (obj2.VisitType == "130")
                return "3";
            return "";
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            AddLog(Permission.查看,obj);
        }
       
    }
}